package com.gettong.test.SpringCloudCommon.feign;

import com.gettong.test.SpringCloudCommon.entity.User;
import com.gettong.test.SpringCloudCommon.feign.fallback.UserFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by gettong on 2019/11/30.
 */
@FeignClient(name = "feign-provider-9100", fallbackFactory = UserFeignFallbackFactory.class)
public interface UserFeign {

    @GetMapping("/user/list")
    List<User> list();

    @GetMapping("/user/{id}")
    User get(@PathVariable("id") Long id);

    @PostMapping("/user/")
    void save(@RequestBody User user);

    @DeleteMapping("/user/{id}")
    void delete(@PathVariable("id") Long id);

}
